/**
  ********************************  STM32F0xx  *********************************
  * @???     : spi.h
  * @??       : strongerHuang
  * @???     : V1.5.0
  * @????   : V1.0.0
  * @??       : 2016?06?04?
  * @??       : SPI???
  ******************************************************************************/

/* ???????? ----------------------------------------------------------*/
#ifndef _SPI_H
#define _SPI_H

/* ?????? --------------------------------------------------------------*/
#include "stm32f0xx.h"


/* ??? --------------------------------------------------------------------*/
#define PORT_SPI_CS               GPIOA
#define PORT_SPI_SCK              GPIOA
#define PORT_SPI_MISO             GPIOA
#define PORT_SPI_MOSI             GPIOA

#define PIN_SPI_CS                GPIO_Pin_4
#define PIN_SPI_SCK               GPIO_Pin_5
#define PIN_SPI_MISO              GPIO_Pin_6
#define PIN_SPI_MOSI              GPIO_Pin_7

#define SFLASH_CS_ENABLE          (PORT_SPI_CS->BRR  = PIN_SPI_CS)
#define SFLASH_CS_DISABLE         (PORT_SPI_CS->BSRR = PIN_SPI_CS)

/* ???? ------------------------------------------------------------------*/
void SPI_Initializes(void);
uint8_t SPI_WriteReadByte(uint8_t TxData);


#endif /* _SPI_H */

/**** Copyright (C)2016 strongerHuang. All Rights Reserved **** END OF FILE ****/
